#!/usr/bin/env python3
# coding:utf-8
import sys
import weakref
from loguru import logger

logger.remove()
log_screen = logger.add(sys.stdout, level="INFO")

logger.debug("This is log debug!")
logger.info("This is log info!")

def set_log_level(handler, level):
    logger.remove(handler)
    handler = logger.add(sys.stdout, level=level)

set_log_level(log_screen, "DEBUG")
logger.debug("12 This is log debug!")
logger.info("12 This is log info!")
